package org.mdrtwell.designpattern.specification;

public class AndSpecification<T> extends CompositeSpecification<T> {

	private ISpecification<T>	one;
	private ISpecification<T>	other;

	public AndSpecification(ISpecification<T> one,
			ISpecification<T> other) {
		super();
		this.one = one;
		this.other = other;
	}

	@Override
	public boolean isStatisfiedBy(T candidate) {
		return one.isStatisfiedBy(candidate) && other.isStatisfiedBy(candidate);
	}

}
